﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="welcome.aspx.cs" Inherits="newBlog.model.welcome1" %>
<%@ Import Namespace="newBlog.CenterInc.Ctrltor" %>
<%@ Import Namespace="newBlog.CenterInc.model" %>
<%@ Register Src="~/model/allLink.ascx" TagPrefix="uc1" TagName="allLink" %>
<%  int page = Request.QueryString["page"]==null?0:Convert.ToInt32(Request.QueryString["page"])-1;
    string search = Request.QueryString["search"]==null?"":Request.QueryString["search"];
    Article_inc article_Inc = new Article_inc();
    int article_count = article_Inc.Article_count(search);
    List<Article_itemDao> list=article_Inc.article_items(page*20,search);
    int count = list.Count;
    int i = 0;

%>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>首页-<%=Application["title"] %></title>
    <meta name="description" content="<%=Application["content"] %>">
    <meta name="keywords" content="<%=Application["key"] %>">
    <uc1:allLink runat="server" id="allLink" />
    <link rel="stylesheet" href="/css/welcome.css?<%=DateTime.Now.ToString("yyyyMMddHHmmssffff") %>">
    <script src="/js/model/welcome.js?<%=DateTime.Now.ToString("yyyyMMddHHmmssffff") %>"></script>
</head>
<body>
<div class="layui-row ">
<div class="layui-panel layui-clear layui-col-space10 margin0">
    <div class="layui-col-md2 layui-col-md-offset8 ">
        <input type="text" id="articleSearch"  placeholder="请输入标题" autocomplete="off" class="layui-input" maxlength="20">
        </div><!--搜索框-->
        <div class="layui-col-md1 ">
        <button type="button" class="layui-btn layui-btn-primary layui-border-blue layui-btn-fluid" onclick="searchButton()"><i class="layui-icon layui-icon-search"></i>
    </button>
        </div>
    <div class="layui-col-md1">
        <button type="button" class="layui-btn layui-btn-primary layui-btn-fluid" onclick="window.location.assign('/model/welcome.aspx')">
        <i class="layui-icon layui-icon-refresh"></i>
        </button>
        </div>
</div>
</div><!--顶部搜索框-->
<div class="layui-row RowSpace layui-col-space20 margin0">
   <%
       for (;i<count;i++) { 
        
       %>
    <div class="layui-col-md3">
    <div class="layui-panel">
        <div class="layui-card">
        <div class="layui-card-header"><a href="javascript:void(0)" onclick="window.parent.open_page('<%=list[i].Title %>','/model/article.aspx?id=<%=list[i].Id %>','article_<%=list[i].Id %>')"><%=list[i].Title %></a></div>
        <div class="layui-card-body boxsize ">
            <div class="article-content articleItemBackground" <%=string.Format("style=\"background-image: url('{0}');\"",list[i].Articleimg) %>>
                <div class="articleItemtransparent">
                    <div class="articleUserImg_name">
                        <img src="<%=list[i].AutorImg%>" class="layui-circle border" width="40px" height="40px">
                        <lable style="vertical-align: bottom;color: #b4b4b4"><%=list[i].AutorName %></lable>
                    </div>
                    <div class="article-content-priview">
                        <div class="article-content-priview-content text-Cols-hide	"><%=list[i].Describe %></div>
                        <div class="article-content-priview-tips boxsize">
                        <label><i class="layui-icon layui-icon-date"></i><%=list[i].Time %></label>
                        <label><i class="layui-icon layui-icon-dialogue"></i><%=list[i].CommentCount %></label>
                        <label><i class="layui-icon layui-icon-dollar"></i><%=list[i].Price %></label>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        </div>
    </div>
    </div><!--内容框1-->
       <%} %>
    
</div><!--中部内容-->
<div class="layui-row" style="text-align: center">
<div id="Page"></div>
<script>
RenderPage('Page',<%=article_count%>,20,2,'fenye',['prev','page','next','count','skip'],pagejump());
</script>
</div>
</body>
</html>
